<template>
  <div>
    <p>商品列表</p>
    <ul>
      <li v-for="(item,index) in goodsList" :key="index">
        <router-link :to="'/detail/'+item.name">{{item.name}}</router-link>
      </li>
    </ul>
  </div>  
</template>

<script>
export default {
  data() {
    return {
      goodsList: [
        {name: 'iphone', id: '001'},
        {name: 'huawei', id: '002'},
        {name: 'xiaomi', id: '003'},
      ]
    }
  },
}
</script>

<style>

</style>